<template>
	<el-drawer title="出入详情" v-model="visible" :size="600" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="库房编号" prop="roomNumber">{{form.roomNumber}}</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="进入类型" prop="accessTypeName">{{form.accessTypeName}}</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="人员类型" prop="isOut">{{form.isOut=='0'?'内部':'外部'}}</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="联系电话" prop="phone">{{form.phone}}
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="24" v-if="form.isOut=='0'">
					<el-col :lg="12">
						<el-form-item label="部门名称" prop="deptName">{{form.deptName}}</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="人员姓名" prop="inUserName">{{form.inUserName}}
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="24" v-if="form.isOut=='1'">
					<el-col :lg="24">
						<el-form-item label="人员单位" prop="orgName">{{form.orgName}}</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="进入人员" prop="userName">{{form.userName}}</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="证件号码" prop="cardId">{{form.cardId}}
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="进入时间" prop="accessTime">{{form.accessTime}}</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="离开时间" prop="leaveTime">{{form.leaveTime}}
						</el-form-item>
					</el-col>
				</el-row>
				<el-form-item label="进入事由" prop="reason">{{form.reason}}</el-form-item>
				<el-form-item label="备注说明" prop="remark">{{form.remark}}</el-form-item>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>
<script>


export default {
	emits: ['success', 'closed'],
	data() {
		return {
			visible: false,
			isSaveing: false,
			loading:false,
			//所需数据选项
			form: {
				recordId:'',
				roomNumber: '',
				accessType: '',
				isOut: '0',
				phone: '',
				deptName:'',
				inUserName:'',
				orgName:'',
				userName: '',
				cardId:'',
				accessTime:'',
				leaveTime:'',
				remark: '',
				reason:'',
			}
		}
	},
	mounted() {
	},
	methods: {
		open() {
			this.visible = true;
			return this
		},
		setData(data) {
			this.form.recordId = data.recordId
			this.form.roomNumber = data.roomNumber
			this.form.accessTypeName = data.accessTypeName
			this.form.isOut = data.isOut
			this.form.inUserName =data.inUserName
			this.form.deptName = data.deptName
			this.form.orgName = data.orgName
			this.form.phone = data.phone
			this.form.userName = data.userName
			this.form.cardId = data.cardId
			this.form.accessTime = data.accessTime
			this.form.leaveTime = data.leaveTime
			this.form.reason = data.reason
			this.form.remark = data.remark
		},
	}
}
</script>

<style>
.customWidth {
	width: 60%;
}
</style>
